/**
 * This is a generated class and is not intended for modification.  To customize behavior
 * of this value object you may modify the generated sub-class of this class - Systems.as.
 */

package valueObjects
{
import com.adobe.fiber.services.IFiberManagingService;
import com.adobe.fiber.util.FiberUtils;
import com.adobe.fiber.valueobjects.IValueObject;
import flash.events.Event;
import flash.events.EventDispatcher;
import mx.binding.utils.ChangeWatcher;
import mx.collections.ArrayCollection;
import mx.events.PropertyChangeEvent;
import mx.validators.ValidationResult;

import flash.net.registerClassAlias;
import flash.net.getClassByAlias;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;

use namespace model_internal;

[Managed]
[ExcludeClass]
public class _Super_Systems extends flash.events.EventDispatcher implements com.adobe.fiber.valueobjects.IValueObject
{
    model_internal static function initRemoteClassAliasSingle(cz:Class) : void
    {
    }

    model_internal static function initRemoteClassAliasAllRelated() : void
    {
    }

    model_internal var _dminternal_model : _SystemsEntityMetadata;
    model_internal var _changedObjects:mx.collections.ArrayCollection = new ArrayCollection();

    public function getChangedObjects() : Array
    {
        _changedObjects.addItemAt(this,0);
        return _changedObjects.source;
    }

    public function clearChangedObjects() : void
    {
        _changedObjects.removeAll();
    }

    /**
     * properties
     */
    private var _internal_id : int;
    private var _internal_en_UK : String;
    private var _internal_de_DE : String;
    private var _internal_de_AT : String;
    private var _internal_bg_BG : String;
    private var _internal_cz_CZ : String;
    private var _internal_es_ES : String;
    private var _internal_sk_SK : String;
    private var _internal_nl_BE : String;
    private var _internal_fr_BE : String;

    private static var emptyArray:Array = new Array();


    /**
     * derived property cache initialization
     */
    model_internal var _cacheInitialized_isValid:Boolean = false;

    model_internal var _changeWatcherArray:Array = new Array();

    public function _Super_Systems()
    {
        _model = new _SystemsEntityMetadata(this);

        // Bind to own data or source properties for cache invalidation triggering
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "en_UK", model_internal::setterListenerEn_UK));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "de_DE", model_internal::setterListenerDe_DE));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "de_AT", model_internal::setterListenerDe_AT));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "bg_BG", model_internal::setterListenerBg_BG));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "cz_CZ", model_internal::setterListenerCz_CZ));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "es_ES", model_internal::setterListenerEs_ES));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "sk_SK", model_internal::setterListenerSk_SK));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "nl_BE", model_internal::setterListenerNl_BE));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "fr_BE", model_internal::setterListenerFr_BE));

    }

    /**
     * data/source property getters
     */

    [Bindable(event="propertyChange")]
    public function get id() : int
    {
        return _internal_id;
    }

    [Bindable(event="propertyChange")]
    public function get en_UK() : String
    {
        return _internal_en_UK;
    }

    [Bindable(event="propertyChange")]
    public function get de_DE() : String
    {
        return _internal_de_DE;
    }

    [Bindable(event="propertyChange")]
    public function get de_AT() : String
    {
        return _internal_de_AT;
    }

    [Bindable(event="propertyChange")]
    public function get bg_BG() : String
    {
        return _internal_bg_BG;
    }

    [Bindable(event="propertyChange")]
    public function get cz_CZ() : String
    {
        return _internal_cz_CZ;
    }

    [Bindable(event="propertyChange")]
    public function get es_ES() : String
    {
        return _internal_es_ES;
    }

    [Bindable(event="propertyChange")]
    public function get sk_SK() : String
    {
        return _internal_sk_SK;
    }

    [Bindable(event="propertyChange")]
    public function get nl_BE() : String
    {
        return _internal_nl_BE;
    }

    [Bindable(event="propertyChange")]
    public function get fr_BE() : String
    {
        return _internal_fr_BE;
    }

    public function clearAssociations() : void
    {
    }

    /**
     * data/source property setters
     */

    public function set id(value:int) : void
    {
        var oldValue:int = _internal_id;
        if (oldValue !== value)
        {
            _internal_id = value;
        }
    }

    public function set en_UK(value:String) : void
    {
        var oldValue:String = _internal_en_UK;
        if (oldValue !== value)
        {
            _internal_en_UK = value;
        }
    }

    public function set de_DE(value:String) : void
    {
        var oldValue:String = _internal_de_DE;
        if (oldValue !== value)
        {
            _internal_de_DE = value;
        }
    }

    public function set de_AT(value:String) : void
    {
        var oldValue:String = _internal_de_AT;
        if (oldValue !== value)
        {
            _internal_de_AT = value;
        }
    }

    public function set bg_BG(value:String) : void
    {
        var oldValue:String = _internal_bg_BG;
        if (oldValue !== value)
        {
            _internal_bg_BG = value;
        }
    }

    public function set cz_CZ(value:String) : void
    {
        var oldValue:String = _internal_cz_CZ;
        if (oldValue !== value)
        {
            _internal_cz_CZ = value;
        }
    }

    public function set es_ES(value:String) : void
    {
        var oldValue:String = _internal_es_ES;
        if (oldValue !== value)
        {
            _internal_es_ES = value;
        }
    }

    public function set sk_SK(value:String) : void
    {
        var oldValue:String = _internal_sk_SK;
        if (oldValue !== value)
        {
            _internal_sk_SK = value;
        }
    }

    public function set nl_BE(value:String) : void
    {
        var oldValue:String = _internal_nl_BE;
        if (oldValue !== value)
        {
            _internal_nl_BE = value;
        }
    }

    public function set fr_BE(value:String) : void
    {
        var oldValue:String = _internal_fr_BE;
        if (oldValue !== value)
        {
            _internal_fr_BE = value;
        }
    }

    /**
     * Data/source property setter listeners
     *
     * Each data property whose value affects other properties or the validity of the entity
     * needs to invalidate all previously calculated artifacts. These include:
     *  - any derived properties or constraints that reference the given data property.
     *  - any availability guards (variant expressions) that reference the given data property.
     *  - any style validations, message tokens or guards that reference the given data property.
     *  - the validity of the property (and the containing entity) if the given data property has a length restriction.
     *  - the validity of the property (and the containing entity) if the given data property is required.
     */

    model_internal function setterListenerEn_UK(value:flash.events.Event):void
    {
        _model.invalidateDependentOnEn_UK();
    }

    model_internal function setterListenerDe_DE(value:flash.events.Event):void
    {
        _model.invalidateDependentOnDe_DE();
    }

    model_internal function setterListenerDe_AT(value:flash.events.Event):void
    {
        _model.invalidateDependentOnDe_AT();
    }

    model_internal function setterListenerBg_BG(value:flash.events.Event):void
    {
        _model.invalidateDependentOnBg_BG();
    }

    model_internal function setterListenerCz_CZ(value:flash.events.Event):void
    {
        _model.invalidateDependentOnCz_CZ();
    }

    model_internal function setterListenerEs_ES(value:flash.events.Event):void
    {
        _model.invalidateDependentOnEs_ES();
    }

    model_internal function setterListenerSk_SK(value:flash.events.Event):void
    {
        _model.invalidateDependentOnSk_SK();
    }

    model_internal function setterListenerNl_BE(value:flash.events.Event):void
    {
        _model.invalidateDependentOnNl_BE();
    }

    model_internal function setterListenerFr_BE(value:flash.events.Event):void
    {
        _model.invalidateDependentOnFr_BE();
    }


    /**
     * valid related derived properties
     */
    model_internal var _isValid : Boolean;
    model_internal var _invalidConstraints:Array = new Array();
    model_internal var _validationFailureMessages:Array = new Array();

    /**
     * derived property calculators
     */
    

    /**
     * isValid calculator
     */
    model_internal function calculateIsValid():Boolean
    {
        var violatedConsts:Array = new Array();
        var validationFailureMessages:Array = new Array();

        var propertyValidity:Boolean = true;
        if (!_model.en_UKIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_en_UKValidationFailureMessages);
        }
        if (!_model.de_DEIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_de_DEValidationFailureMessages);
        }
        if (!_model.de_ATIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_de_ATValidationFailureMessages);
        }
        if (!_model.bg_BGIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_bg_BGValidationFailureMessages);
        }
        if (!_model.cz_CZIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_cz_CZValidationFailureMessages);
        }
        if (!_model.es_ESIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_es_ESValidationFailureMessages);
        }
        if (!_model.sk_SKIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_sk_SKValidationFailureMessages);
        }
        if (!_model.nl_BEIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_nl_BEValidationFailureMessages);
        }
        if (!_model.fr_BEIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_fr_BEValidationFailureMessages);
        }

        model_internal::_cacheInitialized_isValid = true;
        model_internal::invalidConstraints_der = violatedConsts;
        model_internal::validationFailureMessages_der = validationFailureMessages;
        return violatedConsts.length == 0 && propertyValidity;
    }

    /**
     * derived property setters
     */

    model_internal function set isValid_der(value:Boolean) : void
    {
        var oldValue:Boolean = model_internal::_isValid;
        if (oldValue !== value)
        {
            model_internal::_isValid = value;
            _model.model_internal::fireChangeEvent("isValid", oldValue, model_internal::_isValid);
        }
    }

    /**
     * derived property getters
     */

    [Transient]
    [Bindable(event="propertyChange")]
    public function get _model() : _SystemsEntityMetadata
    {
        return model_internal::_dminternal_model;
    }

    public function set _model(value : _SystemsEntityMetadata) : void
    {
        var oldValue : _SystemsEntityMetadata = model_internal::_dminternal_model;
        if (oldValue !== value)
        {
            model_internal::_dminternal_model = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "_model", oldValue, model_internal::_dminternal_model));
        }
    }

    /**
     * methods
     */


    /**
     *  services
     */
    private var _managingService:com.adobe.fiber.services.IFiberManagingService;

    public function set managingService(managingService:com.adobe.fiber.services.IFiberManagingService):void
    {
        _managingService = managingService;
    }

    model_internal function set invalidConstraints_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_invalidConstraints;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_invalidConstraints = value;
            _model.model_internal::fireChangeEvent("invalidConstraints", oldValue, model_internal::_invalidConstraints);
        }
    }

    model_internal function set validationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_validationFailureMessages;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_validationFailureMessages = value;
            _model.model_internal::fireChangeEvent("validationFailureMessages", oldValue, model_internal::_validationFailureMessages);
        }
    }

    model_internal var _doValidationCacheOfEn_UK : Array = null;
    model_internal var _doValidationLastValOfEn_UK : String;

    model_internal function _doValidationForEn_UK(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfEn_UK != null && model_internal::_doValidationLastValOfEn_UK == value)
           return model_internal::_doValidationCacheOfEn_UK ;

        _model.model_internal::_en_UKIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isEn_UKAvailable && _internal_en_UK == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "en_UK is required"));
        }

        model_internal::_doValidationCacheOfEn_UK = validationFailures;
        model_internal::_doValidationLastValOfEn_UK = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfDe_DE : Array = null;
    model_internal var _doValidationLastValOfDe_DE : String;

    model_internal function _doValidationForDe_DE(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfDe_DE != null && model_internal::_doValidationLastValOfDe_DE == value)
           return model_internal::_doValidationCacheOfDe_DE ;

        _model.model_internal::_de_DEIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isDe_DEAvailable && _internal_de_DE == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "de_DE is required"));
        }

        model_internal::_doValidationCacheOfDe_DE = validationFailures;
        model_internal::_doValidationLastValOfDe_DE = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfDe_AT : Array = null;
    model_internal var _doValidationLastValOfDe_AT : String;

    model_internal function _doValidationForDe_AT(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfDe_AT != null && model_internal::_doValidationLastValOfDe_AT == value)
           return model_internal::_doValidationCacheOfDe_AT ;

        _model.model_internal::_de_ATIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isDe_ATAvailable && _internal_de_AT == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "de_AT is required"));
        }

        model_internal::_doValidationCacheOfDe_AT = validationFailures;
        model_internal::_doValidationLastValOfDe_AT = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfBg_BG : Array = null;
    model_internal var _doValidationLastValOfBg_BG : String;

    model_internal function _doValidationForBg_BG(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfBg_BG != null && model_internal::_doValidationLastValOfBg_BG == value)
           return model_internal::_doValidationCacheOfBg_BG ;

        _model.model_internal::_bg_BGIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isBg_BGAvailable && _internal_bg_BG == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "bg_BG is required"));
        }

        model_internal::_doValidationCacheOfBg_BG = validationFailures;
        model_internal::_doValidationLastValOfBg_BG = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfCz_CZ : Array = null;
    model_internal var _doValidationLastValOfCz_CZ : String;

    model_internal function _doValidationForCz_CZ(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfCz_CZ != null && model_internal::_doValidationLastValOfCz_CZ == value)
           return model_internal::_doValidationCacheOfCz_CZ ;

        _model.model_internal::_cz_CZIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isCz_CZAvailable && _internal_cz_CZ == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "cz_CZ is required"));
        }

        model_internal::_doValidationCacheOfCz_CZ = validationFailures;
        model_internal::_doValidationLastValOfCz_CZ = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfEs_ES : Array = null;
    model_internal var _doValidationLastValOfEs_ES : String;

    model_internal function _doValidationForEs_ES(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfEs_ES != null && model_internal::_doValidationLastValOfEs_ES == value)
           return model_internal::_doValidationCacheOfEs_ES ;

        _model.model_internal::_es_ESIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isEs_ESAvailable && _internal_es_ES == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "es_ES is required"));
        }

        model_internal::_doValidationCacheOfEs_ES = validationFailures;
        model_internal::_doValidationLastValOfEs_ES = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfSk_SK : Array = null;
    model_internal var _doValidationLastValOfSk_SK : String;

    model_internal function _doValidationForSk_SK(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfSk_SK != null && model_internal::_doValidationLastValOfSk_SK == value)
           return model_internal::_doValidationCacheOfSk_SK ;

        _model.model_internal::_sk_SKIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isSk_SKAvailable && _internal_sk_SK == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "sk_SK is required"));
        }

        model_internal::_doValidationCacheOfSk_SK = validationFailures;
        model_internal::_doValidationLastValOfSk_SK = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfNl_BE : Array = null;
    model_internal var _doValidationLastValOfNl_BE : String;

    model_internal function _doValidationForNl_BE(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfNl_BE != null && model_internal::_doValidationLastValOfNl_BE == value)
           return model_internal::_doValidationCacheOfNl_BE ;

        _model.model_internal::_nl_BEIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isNl_BEAvailable && _internal_nl_BE == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "nl_BE is required"));
        }

        model_internal::_doValidationCacheOfNl_BE = validationFailures;
        model_internal::_doValidationLastValOfNl_BE = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfFr_BE : Array = null;
    model_internal var _doValidationLastValOfFr_BE : String;

    model_internal function _doValidationForFr_BE(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfFr_BE != null && model_internal::_doValidationLastValOfFr_BE == value)
           return model_internal::_doValidationCacheOfFr_BE ;

        _model.model_internal::_fr_BEIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isFr_BEAvailable && _internal_fr_BE == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "fr_BE is required"));
        }

        model_internal::_doValidationCacheOfFr_BE = validationFailures;
        model_internal::_doValidationLastValOfFr_BE = value;

        return validationFailures;
    }
    

}

}
